package com.imooc.mall.pojo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Future;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
public class User {

    private Integer id;
    @NotNull(message = "用户名不能为空")
    @NotEmpty(message = "用户名不能为空字符串")
    private String username;
    @NotNull(message = "密码不能为空")
    @NotEmpty(message = "密码不能为空字符串")
    private String password;
    @NotNull(message = "邮箱不能为空")
    private String email;
    @NotNull(message = "手机号不能为空")
    @Length(min = 11,max = 11,message = "手机号必须为11为")
    private String phone;

    private String question;

    private String answer;

    private Integer role;
    @Future(message = "时间必须是将来时间")
    private Date createTime;
    @Future(message = "时间必须是将来时间")
    private Date updateTime;

}